<?php

/**
 *  Description of Field
 *
 * @author LJ <jun.lu.726@gmail.com>
 * @copyright 2012-2013 shangbox.com
 * $Id: Field.php 162 2012-11-09 04:04:30Z Jun.Lu.726@gmail.com $
 * @history    2012-10-16  12:04:41::  Lujun  ::  Create File
 */
class Model_Ad_Field extends Model_AbstractDao
{

    protected $_dbName     = 'BingoMobi';
    protected $_tableName  = 'bg_ad_collect_field';
    protected $_primaryKey = 'ad_id';
    protected $_nameField  = 'field_id';

    /**
     *  收集字段
     * @param type $fieldIdArr
     * @return boolean
     */
    public function fieldArrIn($fieldIdArr, $adId)
    {
        if ($fieldIdArr) {
            $fieldIdArrEnd = array();
            foreach ($fieldIdArr as $val) {
                $tmpf['ad_id']    = $adId;
                $tmpf['field_id'] = $val;
                $fieldIdArrEnd[]  = $tmpf;
            }

            return $this->batchInsert($fieldIdArrEnd);
        }
        return false;
    }

}

